n=int(input())
result=0
for i in range(0,n):
    x,y=map(int,input().split())
    result+=x*y
result=max(result,0)
print(result)